#include "stdafx.h"
#include "TestSele.h"
#include "Sele.h"

CPPUNIT_TEST_SUITE_REGISTRATION( TestSele );
using namespace PDMS::PDMSFrame; 

TestSele::TestSele()
{
}


TestSele::~TestSele()
{
}

void TestSele::TestClone()
{
	UeDbObject* pSele = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Sele) );
	CPPUNIT_ASSERT( pSele );
	CPPUNIT_ASSERT( pSele->Clone() );

}

void TestSele::TestIsLegalParent()
{
	UeDbObject* pSele = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Sele) );
	UeDbObject* pObj = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spec) );
	UeDbObject* pWorld = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(World));
	CPPUNIT_ASSERT( pWorld );
	CPPUNIT_ASSERT( pSele );
	CPPUNIT_ASSERT( pObj);
	CPPUNIT_ASSERT( !pSele->IsLegalParent(pWorld) );
	CPPUNIT_ASSERT( pSele->IsLegalParent( pSele ) );
	CPPUNIT_ASSERT( pSele->IsLegalParent( pObj ) );
}	